<?php

declare(strict_types=1);

namespace App\Controller\Pda\v1;

use App\Controller\AbstractController;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
use Service\UserService\CashManagerService;
use Hyperf\Di\Annotation\Inject;
use App\Middleware\PdaMiddleware;
use Hyperf\HttpServer\Annotation\Middleware;

/**
 * 登录控制器
 * @Controller(prefix="/pda/v1/manager")
 * @Middleware(PdaMiddleware::class)
 */
class ManagerController extends AbstractController
{
    
    
    /**
     * 登录接口
     * @RequestMapping(path="editpasswd", methods="post")
     */
    public function editpasswd(RequestInterface $request ,CashManagerService $authService)
    {
        return $authService->editPassword($request->getAttribute('manager_id'),$request->getParsedBody());
    }
    
    /**
     * 登录接口
     * @RequestMapping(path="getinfo", methods="post")
     */
    public function getInfo(RequestInterface $request ,CashManagerService $authService)
    {
        return $authService->getInfo($request->getAttribute('manager_id'));
    }
    
}
